Skip to content

Conversation

@martincostello
Copy link
Member

Changes

  • Hoist condition out of lambda to only evaluate it once.
  • Simplify delegate declaration.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

- Hoist condition out of lambda to only evaluate it once.
- Simplify delegate declaration.
@github-actions github-actions bot added the pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package label Jan 27, 2026
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.89%. Comparing base (496e4ac) to head (63f7bae).
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6852      +/-   ##
==========================================
- Coverage   86.90%   86.89%   -0.01%     
==========================================
  Files         263      263              
  Lines       12382    12381       -1     
==========================================
- Hits        10761    10759       -2     
- Misses       1621     1622       +1     
Flag Coverage Δ
unittests-Project-Experimental 86.76% <100.00%> (+0.04%) ⬆️
unittests-Project-Stable 86.70% <100.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/OpenTelemetry/Trace/TracerProviderSdk.cs 99.35% <100.00%> (-0.01%) ⬇️

... and 1 file with indirect coverage changes

@martincostello martincostello marked this pull request as ready for review January 27, 2026 15:58
@martincostello martincostello requested a review from a team as a code owner January 27, 2026 15:58
Copilot AI review requested due to automatic review settings January 27, 2026 15:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors lambda expressions in the TracerProviderSdk for better performance and code clarity. The changes optimize conditional evaluation and simplify delegate declarations without altering the functional behavior.

Changes:

  • Simplified lambda expression in Any() method using method group conversion
  • Hoisted supportLegacyActivity condition check out of lambda to evaluate once at assignment time instead of on every invocation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:OpenTelemetry Issues related to OpenTelemetry NuGet package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant